import Vue from 'vue'
import Vuex from 'vuex'
import { setStore } from "@/utils/mUtils.js"
import { getTickerLogin } from '@/api/user'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
  },
  mutations: {
  },
  actions: {
    async getTicker ({ commit }, { ticket }) {
      const res = await getTickerLogin({ ticket }).catch(err => err)
      if (res.code == '200') {
        let result = res.data
        setStore("token",result.sessionId);
      }
      return res
    }
  },
  modules: {
  }
})
